import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:webview_flutter/webview_flutter.dart';

import 'logic.dart';

class WebViewPage extends GetView<WebViewLogic> {
  const WebViewPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios_new_rounded),
          onPressed: () async {
            if (await controller.canBack()) {
              Get.back();
            }
          },
        ),
        title: Obx(() => Text(controller.title.value)),
      ),
      body: WebViewWidget(controller: controller.webController),
    );
  }
}
